package com.jxnu.project_z_android.navigation_demo.ui;


import android.os.Bundle;

import com.jxnu.project_z_android.R;
import com.jxnu.project_z_android.databinding.ActivityNaviMainBinding;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;
import androidx.navigation.ui.NavigationUI;


public class NaviMainActivity extends AppCompatActivity {

    private ActivityNaviMainBinding activityNaviMainBinding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        activityNaviMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_navi_main);

        initEvent();

    }

    private void initEvent() {
        NavController navController = Navigation.findNavController(this, R.id.fragment);
        NavigationUI.setupActionBarWithNavController(this, navController);
    }

    private void initData() {

    }

    @Override
    public boolean onSupportNavigateUp() {
        NavController navController = Navigation.findNavController(this, R.id.fragment);
        return navController.navigateUp();
    }
}
